# -*- coding: utf-8 -*-
# @Time : 2021/9/1 17:51
# @Author : 唐宁
# @Site :
# @File : ErrorCodeException.py
# @Software: PyCharm
from typing import Optional

from exception.ErrorCodeEnum import ErrorCodeEnum


class ErrorCodeException(Exception):
    """
    自定义异常类
    """

    def __init__(self, ex: ErrorCodeEnum, msg=None):
        self.ex = ex
        # 消息处理
        if msg is None:
            self.msg = ex.msg
        else:
            self.msg = msg
